﻿Imports System.Data.OleDb
Public Class rss
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim sqlconnection As OleDbConnection = New OleDbConnection(ConfigurationManager.ConnectionStrings("mercedesbenzconnectionstring").ConnectionString)
        Dim sql As String = "SELECT model,body_type, id FROM cars ORDER BY id desc"
        Dim mycommand As OleDbCommand = New OleDbCommand(sql, sqlconnection)

        sqlconnection.Open()
        rptRSS.DataSource = mycommand.ExecuteReader()
        rptRSS.DataBind()
        sqlconnection.Close()

    End Sub
    Public Function FormatForXML(ByRef data As String) As String

        data = data.Replace("&", "&amp;")
        data = data.Replace("\", "&quot;")
        data = data.Replace("'", "&apos;")
        data = data.Replace("<", "&lt;")
        data = data.Replace(">", "&gt;")

        Return data

    End Function
End Class